﻿using System;
using System.Collections.Generic;
using System.Windows;
using Agnes.Core;
using Agnes.Libaray;
using Caliburn.Micro;
using DevExpress.Xpf.Bars;
using DevExpress.Xpf.Ribbon;
using ICSharpCode.Core;
using System.Reflection;
using System.Collections.ObjectModel;
using DevExpress.Xpf.Docking;
using Agnes.Core;

namespace Agnes.Mainframe
{
    internal class MainframeViewModel : PropertyChangedBase
    {
        #region New Sln View and ViewModel

        #region BindProperty

        private NewSlnView _newSlnView;

        /// <summary>
        /// NewSlnView
        /// </summary>
        public NewSlnView NewSlnView
        {
            get { return _newSlnView; }
            set
            {
                _newSlnView = value;
                NotifyOfPropertyChange(() => NewSlnView);
            }
        }

        public NewSlnViewModel NewSlnViewModel { get; private set; }

        public AgnesSln NewSln { get; private set; }

        #endregion

        public void NewSlnViewLoaded()
        {
            NewSlnView = new NewSlnView();
            NewSln = AgnesSln.CreateAsChild();
            NewSlnViewModel = new NewSlnViewModel(NewSln);
            ViewModelBinder.Bind(NewSlnViewModel, NewSlnView, null);
        }

        #endregion

        #region Open Sln View and View Model

        private OpenSlnView _openSlnView;

        /// <summary>
        /// 
        /// </summary>
        public OpenSlnView OpenSlnView
        {
            get { return _openSlnView; }
            set
            {
                _openSlnView = value;
                NotifyOfPropertyChange(() => OpenSlnView);
            }
        }

        public OpenSlnViewModel OpenSlnViewModel { get; private set; }

        /// <summary>
        /// 
        /// </summary>
        public void OpenSlnViewLoaded()
        {
            OpenSlnView = new OpenSlnView();
            OpenSlnViewModel = new OpenSlnViewModel();
            ViewModelBinder.Bind(OpenSlnViewModel, OpenSlnView, null);
        }

        #endregion

        #region BindProperty

        public ObservableCollection<RibbonPage> RibbonPages { get; private set; }

        public AgnesWorkBenchService AgnesWorkBenchService { get; private set; }

        #endregion

        public MainframeViewModel()
        {
            RibbonPages = AgnesServiceManager.AgnesWorkBenchService.RibbonPages;
            AgnesWorkBenchService = AgnesServiceManager.AgnesWorkBenchService;
        }

    }
}
